<?php

namespace SC\Qiniu\Console;

use Illuminate\Console\Command;

use SC\Qiniu\QiniuClient;


class QiniuRemove extends Command
{
    protected $signature = 'qiniu:rm {key}';
    protected $description = 'Remove file by key';

    public function handle()
    {
        $key = $this->argument('key');

        $qiniuClient = new QiniuClient();
        $err = $qiniuClient->remove($key);
        if ($err) {
            $this->error($err->message());
        }
    }
}